//
//  YTCameraHead.m
//  YUNT
//
//  Created by 梁炜东 on 2017/11/20.
//  Copyright © 2017年 梁炜东. All rights reserved.
//

#import "YTCameraHead.h"
@interface YTCameraHead()
@property(nonatomic, strong)UILabel *titleLabel;
@end

@implementation YTCameraHead

-(instancetype)init
{
    self = [super init];
    if (self)
    {
        self.backgroundColor = [UIColor clearColor];
        [self addSubview:self.titleLabel];
        UIView *line = [[UIView alloc] init];
        line.backgroundColor = YTColorAlpha(210, 210, 210, 0.3);
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.trailing.bottom.equalTo(self);
            make.height.mas_equalTo(1);
        }];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.trailing.equalTo(self);
            make.leading.equalTo(self).offset(10);
            make.height.mas_equalTo(39);
        }];
    }
    return self;
}
-(UILabel *)titleLabel
{
    if (!_titleLabel)
    {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _titleLabel.textColor = YTColor(160, 160, 160);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}
-(void)configObject:(NSString *)text
{
    _titleLabel.text = text;
}
@end
